#include <unordered_map>
class Gift {
public:
    int getValue(vector<int> gifts, int n) {
        unordered_map<int, int>mp;
        for(auto e:gifts)
        {
            mp[e]++;
        }
        for(auto e:gifts)
        {
            if(mp[e]>n/2)
                return e;
        }
        return 0;
    }
};